<template>
  <van-nav-bar
    class="navBar"
    @click-left="$router.push(path)"
    @click-right="$emit('rightClick')"
  >
    <template #left>
      <i class="iconfont f44">&#xe637;</i>
    </template>
    <template #title center>
      <div class="title">{{ title }}</div>
    </template>
    <template #right>
      <div class="right" v-if="right">{{ right }}</div>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: 'navBar',
  props: ['title', 'right', 'path']
}
</script>

<style lang="less" scoped>
.navBar {
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: center;
    color: #222222;
    letter-spacing: 0px;
  }
  .f44 {
    font-size: 44px;
  }
  ::v-deep.van-nav-bar__left,
  ::v-deep.van-nav-bar__right {
    padding: 0;
  }
  .right {
    padding-right: @p15;
    opacity: 1;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: right;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
}
</style>
